package com.xinqi.xinqidev.publisher.consumer.listeners;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author xin麒
 * @date 2023/11/20 11:59
 */
@Slf4j
@Component
public class MessageDirectQueueListener {
    @RabbitListener(queues = "xinqiyadirect.queue1")
    public void listenWorkQueue1(String msg) throws InterruptedException {
        log.debug("消费者1 监听【xinqiyadirect.queue1】队列，拿到消息：" + "【" + msg + "】");
    }

    @RabbitListener(queues = "xinqiyadirect.queue2")
    public void listenWorkQueue2(String msg) throws InterruptedException {
        log.debug("消费者2 监听【xinqiyadirect.queue2】队列，拿到消息：" + "【" + msg + "】");
    }

}
